Skip to content

[doc] Use cmake -B args instead of cd into build dir#19392

Open
XAheli wants to merge 2 commits intopytorch:mainfrom
XAheli:fix/cmake-sb-args-14759
Open

[doc] Use cmake -B args instead of cd into build dir#19392
XAheli wants to merge 2 commits intopytorch:mainfrom
XAheli:fix/cmake-sb-args-14759

Conversation

@XAheli
Copy link
Copy Markdown
Contributor

@XAheli XAheli commented May 8, 2026

Addresses the remaining item from #14759

Files changed

docs/source/using-executorch-building-from-source.md

  • Replace all 7 cmake .. invocations with cmake -B cmake-out (run from repo root, no cd needed)
  • cmake --preset ios (presets define binaryDir via CMakePresets.json)
  • Remove redundant mkdir cmake-out before cmake -B (cmake creates it automatically)
  • Add missing windows preset to documented presets list (exists in CMakePresets.json)
  • Remove orphaned text fragment in "Linking Without CMake" section (leftover from Update build from source docs #13210)
  • Fix typos: BulildBuild, AdditionAdditional, ccache ref abovebelow

docs/source/kernel-library-selective-build.md

  • Replace cmake .. with cmake -B cmake-out in selective build example

docs/source/using-executorch-runtime-integration.md

  • Fix cmake -b (lowercase, invalid CMake syntax) → cmake -B

Test plan

  • lintrunner passes on all 3 changed files
  • Sphinx docs build succeeds with no new warnings
  • Verified rendered HTML contains no remaining cmake .. patterns

cc @GregoryComer @mergennachin

Copilot AI review requested due to automatic review settings May 8, 2026 16:01
@XAheli XAheli requested a review from mergennachin as a code owner May 8, 2026 16:01
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 8, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19392

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 11 Awaiting Approval

As of commit 4c2cfa6 with merge base ada8e35 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ExecuTorch documentation to use CMake’s -B (binary dir) and presets workflow consistently, avoiding “cd into build dir” patterns and fixing a few small doc issues/typos. This aligns the docs with the CMakePresets-based build flow used in the repo.

Changes:

  • Replace cmake .. / directory-changing examples with cmake -B cmake-out ... where applicable.
  • Document and use cmake --preset ... correctly (including adding the existing windows preset to the documented list).
  • Fix minor doc issues: typos, a broken cmake -b flag, and remove an orphaned text fragment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/source/using-executorch-building-from-source.md Modernizes build instructions to use -B / presets, adds windows preset mention, and fixes typos/stray text.
docs/source/kernel-library-selective-build.md Updates selective build example to use cmake -B cmake-out rather than cmake ...
docs/source/using-executorch-runtime-integration.md Fixes invalid cmake -b to cmake -B in the logging configuration example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@XAheli
Copy link
Copy Markdown
Contributor Author

XAheli commented May 8, 2026

Hi @GregoryComer while working on this I noticed a few more places across the docs that still use the old cmake .. / cd patterns, but I left them out of this PR since they're in backend specific tutorials

  • backends/vulkan/tutorials/etvk-llama-tutorial.md and etvk-profiling-tutorial.md — use cmake . with -DCMAKE_INSTALL_PREFIX=cmake-out-android-so
  • backends/nxp/tutorials/nxp-basic-tutorial.md — uses mkdir build && pushd && cmake ..
  • backends-cadence.md — uses cmake -DCMAKE_TOOLCHAIN_FILE=... -DCMAKE_INSTALL_PREFIX=cmake-out
  • build-run-openvino.md — uses mkdir build && cd build && cmake ..
  • backends-qualcomm.md — uses cd $EXECUTORCH_ROOT/build-x86 && cmake ../examples/qualcomm
  • tutorial-xnnpack-delegate-lowering.md — uses CMAKE_INSTALL_PREFIX=cmake-out (installing into the build directory)

Wanted to flag these and happy to tackle them in a follow up if you think it makes sense. Let me know :)

Copy link
Copy Markdown
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left one comment, but otherwise looks great.

```bash
# Configure the build with the ios preset.
cmake .. --preset ios
cmake --preset ios
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add -B cmake-out here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

@XAheli XAheli force-pushed the fix/cmake-sb-args-14759 branch from 5068c2b to 4c2cfa6 Compare May 10, 2026 14:58
@XAheli XAheli requested a review from GregoryComer May 10, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants